-
Notifications
You must be signed in to change notification settings - Fork 172
Migrate Tofu Controller to OpenTofu #1675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Tofu Controller to OpenTofu #1675
Conversation
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
|
This probably needs to be highlighted as a breaking change for those who build their own runner images and update terraform binary there |
|
This PR may fix #1437 |
Implements support for both Terraform and OpenTofu binaries using
separate Dockerfiles with minimal code changes. This enables teams
to use either binary while maintaining security compliance, with
OpenTofu as the default and a clear deprecation path for Terraform.
Changes:
- Updated runner.Dockerfile and runner-azure.Dockerfile to OpenTofu v1.11.2
- Created runner-terraform.Dockerfile and runner-terraform-azure.Dockerfile
- Updated CI/CD workflows to build all 4 image variants
- Added binary detection in runner/server.go
- Added Terraform v1.14.3 support via separate images
- Updated documentation for binary selection
- Removed unnecessary BINARY_TYPE build arguments
Images published:
- OpenTofu (default): v{VERSION}, latest
- Terraform: v{VERSION}-terraform, latest-terraform
Binary versions:
- OpenTofu: 1.11.2
- Terraform: 1.14.3 (up from 1.5.7)
Breaking changes for Terraform users:
- S3 backend role_arn deprecated (use assume_role block)
- -state flag deprecated (use backend configuration)
- See IMPLEMENTATION_VERIFICATION.md for migration guidance
Related to PR flux-iac#1675
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
Signed-off-by: Alex Marston <[email protected]>
|
lgtm 👍 (I don't have permissions to approve) |
ricardo-mng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM my only concern is the tofu version, we should probably first migrate to version 1.6.2
|
We will have to upgrade to a version newer than 1.6.2 because of the vulnerabilities. Deciding what version. |
For some time, Tofu Controller has only supported up to version
1.5.7of Terraform due to the licensing changes Hashicorp announced and implemented in 2023. As we have not been able to update to a newer version of Terraform and had not completed the migration to OpenTofu, users have been forced to deploy their own custom runner images.This PR starts the process of moving away from Hashicorp Terraform and to the OpenTofu implementation.
For this change, a few changes have been made:
tofubinary available to the runner, pulling this in from the OpenTofu minimal images rather than downloading architecture specific binaries.terraformbinary by default, but will fall back totofuif it cannot be found. As we only ship thetofubinary in the runner base image, this should be the default for standard deployments of Tofu Controller.